﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="warehouseGoodsInventory.aspx.cs" Inherits="WebApp.admin.warehouse.warehouseGoodsInventory" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>
       
    </title>
    <link href="../css/skin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../js/main.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="/My97DatePicker/WdatePicker.js" charset="utf-8"></script>

<script language="javascript" type="text/javascript">

    function checkInventoryForm() {

        if ($("#txtTheme").val() == "") {
            alert("请选择盘点主题！");
            $("#txtTheme").focus();
            return false;
        }

        if ($("#ddlWarehouse").val() == "") {
            alert("请选择仓库！");
            $("#ddlWarehouse").focus();
            return false;
        }
        if ($("#txtStartDate").val() == "") {
            alert("请选择盘点时间！");
            $("#txtStartDate").focus();
            return false;
        }

        return true;

    }

    function setGridWidth(obj)
    {
        alert(document.getElementById("tdGrid").offsetWidth);
        obj.width = document.getElementById("tdGrid").offsetWidth;
    }

</script>
</head>



<body class="body" >
    <table class="main" cellpadding="0" cellspacing="0">

        <tr>
            <td class="td_middle_middle">
                <div class="maincontent">
            <div  class="navgater"><img src="../images/module.gif" width="20" height="22" alt=""/>
所在位置：库存盘点->
<%= Request.QueryString["ot"] == "ed" ? "盘点编辑" : "盘点添加"%>
<a style=" display:block; float:right;" href="javascript:location.href=document.referrer;" ><img src="../images/history.gif" border="0" /></a>
</div>
                    <form id="form1" runat="server">
                    <ext:PageManager ID="PageManager1" runat="server" />
                        <table cellpadding="0" cellspacing="0" style="width: 100%">
                            <tr>
                                <td class="td_title">
                                    盘点主题：</td>
                                <td class="td_content">
                                    <input id="txtTheme" type="text" runat="server" maxlength="50" />*最多50个字符</td>
                            </tr>
                              <tr>
                                <td class="td_title">
                                   仓库列表：</td>
                                <td class="td_content">
                                <ext:DropDownList id="ddlWarehouse" runat="server" AutoPostBack="true"  EnableAjax="true"
                                        onselectedindexchanged="ddlWarehouse_SelectedIndexChanged" ></ext:DropDownList>
                                 </td>
                            </tr>
              
                            <tr>
                                <td class="td_title">
                                    盘点时间：</td>
                                <td class="td_content">
                                   <input id="txtStartDate" type="text" runat="server" onfocus="new WdatePicker(this,'%Y-%M-%D %H:%m:%s',true,'default')"   onpaste="return false" style="ime-mode: disabled" value="" />
                                   *</td>
                            </tr>
       
                            <tr>
                                <td class="td_title">
                                    备注：</td>
                                <td class="td_content">
                                    <textarea id="txtaRemark" runat="server" cols="20" rows="2"></textarea></td>
                            </tr>
                          
                            <tr><td colspan="2" id="tdGrid" style="width:100%;">
                              <ext:Grid ID="Grid1" ShowBorder="true" ShowHeader="true"  
                                    EnableCheckBoxSelect="true"  Title="盘点明细"  BodyStyle="width:100%;" CssStyle="width:99%;"  Height="500" 
        runat="server" DataKeyNames="id" onrowdatabound="Grid1_RowDataBound">
        <Columns>
         

            <ext:TemplateField Width="60px" HeaderText="顺序号">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
                </ItemTemplate>
            </ext:TemplateField>
              <ext:BoundField Width="100px" DataField="id" DataFormatString="{0}" HeaderText="明细编号" />
                <ext:BoundField Width="60px" DataField="goodsId" DataFormatString="{0}" HeaderText="商品编号" />
              <ext:BoundField Width="80px" DataField="goodsNo" DataFormatString="{0}" HeaderText="商品批号" />
               <ext:BoundField Width="100px" DataField="goodsName" DataFormatString="{0}" HeaderText="商品名称" />
              <ext:BoundField Width="100px" DataField="costPrice" DataFormatString="{0:N}" HeaderText="成本价" />
              <ext:BoundField Width="100px" DataField="paperCount" DataFormatString="{0}" HeaderText="账面数量" />
              <ext:BoundField Width="100px" DataField="realyCount" DataFormatString="{0}" HeaderText="实际数量" />
              <ext:BoundField Width="100px" DataField="differenceCount" DataFormatString="{0}" HeaderText="差异数量" />
              <ext:BoundField Width="100px" DataField="goodsBatchNo" DataFormatString="{0}" HeaderText="批号" />

               <ext:TemplateField Width="160px" HeaderText="操作">
                <ItemTemplate>
                   <div style="float:left; display:block;" id="divEdit" runat="server">  <a title="编辑" onclick="openModalForm('warehouseGoodsRealyCount.aspx?action=ed&amp;id=<%# Eval("id") %>')" href="#" >[编辑]</a></div>
                    <div style="float:left; display:block;" id="divDeleted" runat="server">  <a title="删除" href="warehouseGoodsInventory.aspx?action=del&amp;inventoryid=<%# Eval("id")%>&amp;id=<%= InventoryId %>" onclick="javascript:return confirm('你确定要删除吗？');">[删除]</a></div>
                </ItemTemplate>
            </ext:TemplateField>
        </Columns>
    </ext:Grid>

             </td></tr>
                         
                            <tr>
                                <td colspan="2">
                                <ext:Button ID="btnSubmit" runat="server" Text="确  定" CssClass="formButton" 
                                        onclick="btnSubmit_Click"></ext:Button>
                                  &nbsp;&nbsp;&nbsp;&nbsp;
                                    <input id="btnBack" type="button" class="formButton" value=" 返  回 " onclick="javascript:location.href=document.referrer;" /></td>
                            </tr>
                        </table>
                    </form>
                </div>
            </td>
        
        </tr>
    
    </table>
</body>
</html>
